package view;

	import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Rectangle;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;
import java.awt.Font;


	/**
	 * This is the Feedback History Details GUI  extends AbstractGUI
	 * @author Tal Panika	
	 */ 
	public class FeedbackHistoryDetailsGUI  extends AbstractGUI
	{
	
		private JTextArea complaintArea = null;
		private JLabel ReplyLabel = null;
		private JTextArea ReplyTextArea = null;
		private JPanel contentPane=null;
		private JLabel wrnMessage=null;
		

		/**
		 * This is FeedbackHistoryDetailsGUI constructor.
		 * 
		 */
		public FeedbackHistoryDetailsGUI ()
		{ 		  
			
			super();
			
			 //Feedback Details panel
			   contentPane=new JPanel();	
			  //Main Panel 
			   contentPane.setBorder(new TitledBorder(null, "Feedback Details", TitledBorder.LEADING, TitledBorder.TOP, null, null));
			   contentPane.setLayout(null);
			   contentPane.setOpaque(true);
			  
			   contentPane.add(getComplaintArea());
				contentPane.add(getReplyLabel());
				contentPane.add(getReplyArea());
				
				contentPane.add(getBackButton(),BorderLayout.SOUTH);
				contentPane.add(getWrnMessage());
		        

				  //Frame
			        this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			        this.setTitle("Feedback Details Window");
			        this.setContentPane(contentPane);
		      
				    this.setLocationRelativeTo(null); //This will center the JFrame in the middle of the screen
			        this.setLocationByPlatform(true);
			        this.setSize(500, 500);         
		               
		  }
				

		/**
		 * This method initializes Reply Label
		 */
		private JLabel getReplyLabel() {
			if (ReplyLabel == null) {
				ReplyLabel = new JLabel("Reply:");
				ReplyLabel.setFont(new Font("Tahoma", Font.PLAIN, 14));
				ReplyLabel.setBounds(new Rectangle(52, 199, 100, 31));
			}
			return ReplyLabel;
		}
		
		/**
		 * This method initializes Compensation CheckBox
		 */
	

		/**
		 * This method initializes Compliant Details Area
		 */
		private JTextArea getComplaintArea() {
			if (complaintArea == null) {
				complaintArea = new JTextArea();
				complaintArea.setBounds(new Rectangle(50, 70, 350, 118));
				complaintArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
				
			}
			return complaintArea;
		}
		
		/**
		 * This method initializes Reply Area	
		 */
		private JTextArea getReplyArea() {
			if (ReplyTextArea == null) {
				ReplyTextArea = new JTextArea();			
				ReplyTextArea.setBounds(new Rectangle(50, 241, 350, 100));
				ReplyTextArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
				
			}
			return ReplyTextArea;
		}
		
	
		/**
		 * This method creates warning message if currently is null.
		 * @return JLabel type.
		 */
		private JLabel getWrnMessage() {
			if (wrnMessage == null) {
				wrnMessage = new JLabel();
				wrnMessage.setForeground(Color.RED);
				wrnMessage.setBounds(70, 16, 320, 23);
				wrnMessage.setVisible(false);
			}
			return wrnMessage;
		}
		
		/**
		 * This method initializes Back Button	
		 */
		private JButton getBackButton() {
			if (backButton == null) {
				backButton = new JButton();
				backButton.setBounds(new Rectangle(150, 398, 100, 35));
				backButton.setText("Back");
			
			}
			return backButton;
		}
		
		
		

		/**
		 * *********************************Public Methods 
		 */
	
		
		/**
		 * This method display Warning Message.
		 * @param void	 
		 * */
		
		public void displayWrnMessage(String msg){
			wrnMessage.setText(msg);
			wrnMessage.setVisible(true);
		}
		
	
		/**
		 * This set complaintField Area.
		 * @param String Msg 
		 * */
		
		public void setComplaintDetArea(String msg){
			complaintArea.setText(msg);
			complaintArea.setVisible(true);
		}
		
		/**
		 * This set ReplyField Area.
		 * @param String Msg 
		 * */
		
		public void setComplaintReplayArea(String msg){
			ReplyTextArea.setText(msg);
			ReplyTextArea.setVisible(true);
		}
}
